# !/usr/bin python3                                
# encoding: utf-8 -*-
# @file: xxljob_api.py                       
# @author   : wjd
# @Time: 2023/8/23 15:27
from _decimal import Decimal

from api.base_tools_api import BaseToolsApi, BaseToolsApitt, BaseToolsApiDashboard
import decimal
import math


class GenerateBillInterestHandlerTest(BaseToolsApi):

    def __init__(self):
        super().__init__()  # 继承父类属性
        self.url = f'{self.host}/xxl-job-admin/jobinfo/trigger'
        self.method = 'post'
        self.params = {
            "id": 121,
            "executorParam": '{"orderId": 10060466081978}',
            "addressList": ""
        }


class BillInterestHandler(BaseToolsApi):
    """
    定制化借贷生成利息方法
    """

    def __init__(self, orderId, utcNow):
        super().__init__()  # 继承父类属性
        self.url = f'{self.host}/xxl-job-admin/jobinfo/trigger'
        self.method = 'post'
        self.data = {
            "id": 120,
            "executorParam": f'{{"orderId": {orderId}, "utcNow": "{utcNow}"}}',  # 大订单id
            "addressList": ""
        }
        print(self.data['executorParam'])


class SetPrincipalOrMonthlyInterestTest(BaseToolsApi):
    """
    质押借贷生成本息
    """

    def __init__(self, orderId, utcNow):
        super().__init__()  # 继承父类属性
        self.url = f'{self.host}/xxl-job-admin/jobinfo/trigger'
        self.method = 'post'
        self.data = {
            "id": 130,
            "executorParam": f'{{"orderId": {orderId}, "utcNow": "{utcNow}"}}',
            "addressList": ""
        }
        print(self.data['executorParam'])


class Prime_Sp_Dashboard(BaseToolsApiDashboard):
    """
    获取实时利率
    """

    def __init__(self):
        super().__init__()  # 继承父类属性
        self.url = f'{self.host}/api/prime/spDashboard/spDashboard/'
        self.method = 'get'


if __name__ == '__main__':
    pass